package com.ruiysoft.entity.order;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author huazengguang
 * @since 2019-10-13
 */
@TableName("order_relation_commission")
public class OrderRelationCommission extends Model<OrderRelationCommission> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单ID
     */
    @TableField("orderId")
    private Long orderId;

    /**
     * 订单编号
     */
    @TableField("orderCode")
    private String orderCode;

    /**
     * 店铺ID
     */
    @TableField("shopId")
    private Long shopId;

    /**
     * 商品ID
     */
    private Long spu;

    /**
     * 商品规格,型号
     */
    private Long sku;

    /**
     * 用户ID
     */
    @TableField("userId")
    private Long userId;

    /**
     * 购买人ID
     */
    @TableField("buyerId")
    private Long buyerId;

    /**
     * 订单金额(分)
     */
    @TableField("orderAmount")
    private Long orderAmount;

    /**
     * 分销级别(上级为2, 上级的上级为1)
     */
    @TableField("relationLevel")
    private Integer relationLevel;

    /**
     * 分销金额
     */
    private Long amount;

    /**
     * 分销比例
     */
    private BigDecimal ratio;

    /**
     * 分销规则ID
     */
    @TableField("distributionRuleId")
    private Long distributionRuleId;
    /**
     * 是否已经结算   0 未结算  1 已结算
     */
    @TableField("settleFlag")
    private String settleFlag;

    /**
     * 是否已经结算   0 未结算  1 已结算
     */
    private String buyerName;

    /**
     * 结算日期
     */
    @TableField("settleDate")
    private LocalDateTime settleDate;

    /**
     * 结算备注
     */
    @TableField("settleNode")
    private String settleNode;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    public Long getId() {
        return id;
    }

    public OrderRelationCommission setId(Long id) {
        this.id = id;
        return this;
    }
    public Long getOrderId() {
        return orderId;
    }

    public OrderRelationCommission setOrderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }
    public String getOrderCode() {
        return orderCode;
    }

    public String getSettleFlag() {
        return settleFlag;
    }

    public void setSettleFlag(String settleFlag) {
        this.settleFlag = settleFlag;
    }

    public OrderRelationCommission setOrderCode(String orderCode) {
        this.orderCode = orderCode;
        return this;
    }
    public Long getShopId() {
        return shopId;
    }

    public OrderRelationCommission setShopId(Long shopId) {
        this.shopId = shopId;
        return this;
    }
    public Long getSpu() {
        return spu;
    }

    public OrderRelationCommission setSpu(Long spu) {
        this.spu = spu;
        return this;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public OrderRelationCommission setBuyerName(String buyerName) {
        this.buyerName = buyerName;
        return this;
    }

    public Long getSku() {
        return sku;
    }

    public OrderRelationCommission setSku(Long sku) {
        this.sku = sku;
        return this;
    }
    public Long getUserId() {
        return userId;
    }

    public OrderRelationCommission setUserId(Long userId) {
        this.userId = userId;
        return this;
    }
    public Long getBuyerId() {
        return buyerId;
    }

    public OrderRelationCommission setBuyerId(Long buyerId) {
        this.buyerId = buyerId;
        return this;
    }
    public Long getOrderAmount() {
        return orderAmount;
    }

    public OrderRelationCommission setOrderAmount(Long orderAmount) {
        this.orderAmount = orderAmount;
        return this;
    }
    public Integer getRelationLevel() {
        return relationLevel;
    }

    public OrderRelationCommission setRelationLevel(Integer relationLevel) {
        this.relationLevel = relationLevel;
        return this;
    }

    public LocalDateTime getSettleDate() {
        return settleDate;
    }

    public OrderRelationCommission setSettleDate(LocalDateTime settleDate) {
        this.settleDate = settleDate;
        return this;
    }

    public String getSettleNode() {
        return settleNode;
    }

    public OrderRelationCommission setSettleNode(String settleNode) {
        this.settleNode = settleNode;
        return this;
    }

    public Long getAmount() {
        return amount;
    }

    public OrderRelationCommission setAmount(Long amount) {
        this.amount = amount;
        return this;
    }
    public BigDecimal getRatio() {
        return ratio;
    }

    public OrderRelationCommission setRatio(BigDecimal ratio) {
        this.ratio = ratio;
        return this;
    }
    public Long getDistributionRuleId() {
        return distributionRuleId;
    }

    public OrderRelationCommission setDistributionRuleId(Long distributionRuleId) {
        this.distributionRuleId = distributionRuleId;
        return this;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public OrderRelationCommission setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "OrderRelationCommission{" +
            "id=" + id +
            ", orderId=" + orderId +
            ", orderCode=" + orderCode +
            ", shopId=" + shopId +
            ", spu=" + spu +
            ", sku=" + sku +
            ", userId=" + userId +
            ", buyerId=" + buyerId +
            ", orderAmount=" + orderAmount +
            ", relationLevel=" + relationLevel +
            ", amount=" + amount +
            ", ratio=" + ratio +
            ", distributionRuleId=" + distributionRuleId +
            ", createTime=" + createTime +
        "}";
    }
}
